﻿<UserControl x:Class="TestHost.DemoControl"
		xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
		xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
		xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
		xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
		xmlns:WpfTestHost="clr-namespace:TestHost"
		xmlns:Core="clr-namespace:TechNewLogic.GraphIT;assembly=TechNewLogic.GraphIT" mc:Ignorable="d"
		d:DesignHeight="300" d:DesignWidth="300" x:Name="root">

	<UserControl.Resources>

		<Style x:Key="DemoButton" TargetType="ButtonBase">
			<Setter Property="OverridesDefaultStyle" Value="True" />
			<Setter Property="Padding" Value="2" />
			<Setter Property="HorizontalContentAlignment" Value="Center" />
			<Setter Property="VerticalContentAlignment" Value="Center" />
			<Setter Property="Background" Value="Black" />
			<Setter Property="Foreground" Value="WhiteSmoke" />
			<Setter Property="Template">
				<Setter.Value>
					<ControlTemplate TargetType="ButtonBase">
						<Border Background="{TemplateBinding Background}" BorderBrush="WhiteSmoke"
								BorderThickness="1.5" CornerRadius="0">
							<ContentPresenter Margin="{TemplateBinding Padding}"
									HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
									VerticalAlignment="{TemplateBinding VerticalContentAlignment}" />
						</Border>
						<ControlTemplate.Triggers>
							<Trigger Property="IsMouseOver" Value="true">
								<Setter Property="Background" Value="#606060" />
							</Trigger>
							<Trigger Property="IsPressed" Value="true">
								<Setter Property="Background" Value="#707070" />
							</Trigger>
							<Trigger Property="IsEnabled" Value="false">
								<Setter Property="Background" Value="#e0e0e0" />
							</Trigger>
							<Trigger Property="ToggleButton.IsChecked" Value="true">
								<Setter Property="Background" Value="#606060" />
							</Trigger>
						</ControlTemplate.Triggers>
					</ControlTemplate>
				</Setter.Value>
			</Setter>
		</Style>

	</UserControl.Resources>

	<Grid DataContext="{Binding ElementName=root}" Background="Black">
		<Grid.RowDefinitions>
			<RowDefinition Height="Auto" />
			<RowDefinition />
			<RowDefinition Height="Auto" MaxHeight="250" />
		</Grid.RowDefinitions>

		<UniformGrid Columns="6" Margin="1">
			<UniformGrid.Resources>
				<Style x:Key="{x:Type Button}" TargetType="Button"
						BasedOn="{StaticResource DemoButton}" />
				<Style x:Key="{x:Type ToggleButton}" TargetType="ToggleButton"
						BasedOn="{StaticResource DemoButton}" />
			</UniformGrid.Resources>
			<Grid>
				<TextBlock HorizontalAlignment="Center" VerticalAlignment="Center" FontWeight="Bold"
						FontSize="25" Text="{Binding ApplicationTitle}" Foreground="WhiteSmoke"
						FontStyle="Italic" />
				<WpfTestHost:DropdownMenu MenuName="Testing">
					<StackPanel>
						<Button Click="AppendData_Click" Content="Append Data (10s)" />
						<Button Click="PrependData_Click" Content="Prepend Data (10s)" />
						<Button Click="ToggleVisibility_Click" Content="Make Curves (In)visible" />
						<Button Click="ShowAxes_Click" Content="Show Axes" />
						<Button Click="HideAxes_Click" Content="Hide Axes" />
						<Button Click="ChangeColor_Click" Content="Change Color" />
					</StackPanel>
				</WpfTestHost:DropdownMenu>
			</Grid>
			<WpfTestHost:DropdownMenu MenuName="Add / Remove">
				<StackPanel>
					<!--<Button Click="AddCurve_Click" Content="Add Curve" />-->
					<Button Click="RemoveCurve_Click" Content="Remove first Curve" />
				</StackPanel>
			</WpfTestHost:DropdownMenu>
			<WpfTestHost:DropdownMenu MenuName="Custom Controls">
				<StackPanel>
					<Button Click="AddCustomControl_Click"
							Content="Add Random Custom Control to Curve" />
					<Button Click="AddCustomControl1_Click"
							Content="Add Random Custom Control (fixed Y) to Curve" />
					<Button Click="RemoveCustomControl_Click" Content="Remove a Custom Control" />

					<Button Click="AddCustomControl2_Click" Margin="0,5,0,0"
							Content="Add Random Custom Control (fixed Y) to PlottingSystem" />
					<Button Click="RemoveCustomControl2_Click"
							Content="Remove a Custom Control from plotting System" />
				</StackPanel>
			</WpfTestHost:DropdownMenu>
			<WpfTestHost:DropdownMenu MenuName="Print">
				<StackPanel>
					<Button Click="Print_Click" Content="Print" />
					<Button Click="PrintPreview_Click" Content="Print Preview" />
				</StackPanel>
			</WpfTestHost:DropdownMenu>
			<ToggleButton Click="ToggleOnline_Click" Content="Online Mode" />
			<Button Click="Reset_Click" Content="Reset" />
		</UniformGrid>

		<Core:CurveDisplay x:Name="CurveDisplay" Grid.Row="1" Margin="35,20" />
		<ContentControl x:Name="legendHolder" Grid.Row="2" />

	</Grid>

</UserControl>
